import request from '@/utils/request.ts';
import type {
  Category1ResData,
  Category2ResData,
  Category3ResData
} from './type.ts';

// 商品分类相关接口
enum API {
  GET_CATEGORY1 = '/admin/product/getCategory1',
  GET_CATEGORY2 = '/admin/product/getCategory2',
  GET_CATEGORY3 = '/admin/product/getCategory3'
}

export const reqGetCategory1 = () =>
  request.get<any, Category1ResData>(API.GET_CATEGORY1);

export const reqGetCategory2 = (id: number) =>
  request.get<any, Category2ResData>(`${API.GET_CATEGORY2}/${id}`);

export const reqGetCategory3 = (id: number) =>
  request.get<any, Category3ResData>(`${API.GET_CATEGORY3}/${id}`);
